#include "pdlg_decision.h"
#include "ui_pdlg_decision.h"
#include "../scene/customgraphicsscene.h"

DecisionShapePropertiesDialog::DecisionShapePropertiesDialog(DecisionShape *shp, QWidget *parent)
    : shape(shp)
    , QDialog(parent)
    , ui(new Ui::DecisionShapePropertiesDialog)
{
    ui->setupUi(this);
    ui->connectToCorners->setChecked(shape->connectToCorners());
}

DecisionShapePropertiesDialog::~DecisionShapePropertiesDialog()
{
    delete ui;
}

void DecisionShapePropertiesDialog::on_btnOkay_clicked()
{
	shape->emitStateIsAboutToBeChangedByUser();
	shape->setConnectToCorners(ui->connectToCorners->isChecked());
	accept();
}

void DecisionShapePropertiesDialog::on_btnCancel_clicked()
{
	reject();
}
